From: kfraser@localhost.localdomain Date: Thu, 27 Jul 2006 12:17:17 +0000 (+0100) Subject: [IA64] Fix of C/S 10529:4260eb8c08740de0000081c61a6237ffcb95b2d5 for IA64. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~15786^2~1^2~7 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=3461dbd75f6aef0bfe3cf202a059103d75cddfb9;p=xen.git [IA64] Fix of C/S 10529:4260eb8c08740de0000081c61a6237ffcb95b2d5 for IA64. When page is zapped from a domain, the page referenced counter is checked. But it results in false positive alert on Xen/IA64 because a page 'in use' has reference count 2 on Xen/IA64. - a page is assigned to guest domain's psudo physical address space. This is decremented by guest_physmap_remove_page() - a page is allocated for a domain. This is decremented by the following put_page() Signed-off-by: Isaku Yamahata --- diff --git a/xen/common/memory.c b/xen/common/memory.c index 8ed125e98d..0a631ca83e 100644 --- a/xen/common/memory.c +++ b/xen/common/memory.c @@ -170,7 +170,7 @@ guest_remove_page( if ( test_and_clear_bit(_PGC_allocated, &page->count_info) ) put_page(page); - if ( unlikely((page->count_info & PGC_count_mask) != 1) ) + if ( unlikely(!page_is_removable(page)) ) { /* We'll make this a guest-visible error in future, so take heed! */ DPRINTK("Dom%d freeing in-use page %lx (pseudophys %lx):" diff --git a/xen/include/asm-ia64/mm.h b/xen/include/asm-ia64/mm.h index 2ac3d43487..1ec08acce3 100644 --- a/xen/include/asm-ia64/mm.h +++ b/xen/include/asm-ia64/mm.h @@ -213,6 +213,11 @@ static inline int get_page_and_type(struct page_info *page, return rc; } +static inline int page_is_removable(struct page_info *page) +{ + return ((page->count_info & PGC_count_mask) == 2); +} + #define set_machinetophys(_mfn, _pfn) do { } while(0); #ifdef MEMORY_GUARD diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h index 0e4e23b4b9..df2875f1e7 100644 --- a/xen/include/asm-x86/mm.h +++ b/xen/include/asm-x86/mm.h @@ -241,6 +241,11 @@ static inline int get_page_and_type(struct page_info *page, return rc; } +static inline int page_is_removable(struct page_info *page) +{ + return ((page->count_info & PGC_count_mask) == 1); +} + #define ASSERT_PAGE_IS_TYPE(_p, _t) \ ASSERT(((_p)->u.inuse.type_info & PGT_type_mask) == (_t)); \ ASSERT(((_p)->u.inuse.type_info & PGT_count_mask) != 0)